package com.example.gs.mvpdemo.model.imp;

import android.support.annotation.NonNull;

import com.example.gs.mvpdemo.contract.LoginContract;
import com.example.gs.mvpdemo.model.bean.LoginBean;
import com.example.gs.mvpdemo.transformer.CommonTransformer;

import rx.Observer;

/**
 * Created by GaoSheng on 2016/11/26.
 * 20:53
 *
 * @VERSION V1.4
 * com.example.gs.mvpdemo.model
 * 主要做一些数据处理,网路请求
 */

public class LoginModelImp extends LoginContract.LoginModel {

    public void login(@NonNull String username,
                         @NonNull String pwd,
                         @NonNull Observer<LoginBean> bserver) {

        httpService.login(username, pwd)
                .compose(new CommonTransformer<LoginBean>())
                .subscribe(bserver);
    }

}
